import Mock from 'mockjs'
import login from '@/mock/apis/login'
import tag from '@/mock/apis/tag/index'
import team from '@/mock/apis/team/index'
// import index from '@/mock/apis/index'
// import cancel from './apis/cancel'
// import completed from './apis/completed'
// import doing from './apis/doing/doing'
// import pending from './apis/pending/pending'

import { MockParams } from './index.d'
const mocks = [
  ...login,
  ...tag,
  // ...team
  // ...index,
  // ...cancel,
  // ...completed,
  // ...doing,
  // ...pending
]
//设置延时时间
Mock.setup({
  timeout: '300'
})

export function mockXHR() {
  let mock: MockParams
  for (mock of mocks) {
    Mock.mock(new RegExp(mock.url), mock.type || 'get', mock.response)
  }
}
